package cn.seqdata.jpa.converter;

import javax.persistence.AttributeConverter;

public class LongConverter implements AttributeConverter<Long, String> {
	public static final LongConverter instance = new LongConverter();

	@Override
	public String convertToDatabaseColumn(Long attribute) {
		return null != attribute ? attribute.toString() : null;
	}

	@Override
	public Long convertToEntityAttribute(String dbData) {
		return null != dbData ? Long.valueOf(dbData) : null;
	}
}
